package com.hhf.cloud.controller;

import com.hhf.cloud.resp.Result;
import com.hhf.cloud.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Daniel-黄海峰
 * @Description
 * @create 2024/3/2 16:14
 */
@RestController
public class StorageController
{
    @Autowired
    private StorageService storageService;

    /**
     * 扣减库存
     */
    @RequestMapping("/storage/decrease")
    public Result<String> decrease(Long productId, Integer count) {
        storageService.decrease(productId, count);
        return Result.success("扣减库存成功!");
    }
}
